﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Incendios0_1.Camera.wpfdatamanager
{
    /// <summary>
    /// Interaction logic for CameraPropertyWindow.xaml
    /// </summary>
    public partial class CameraPropertyWindow : Window
    {
        CameraData camera;
        Boolean edit;

        public CameraPropertyWindow()
        {
            InitializeComponent();
            camera = new CameraData();
            edit = false;
        }

        public CameraPropertyWindow(CameraData camera)
        {
            InitializeComponent();
            this.camera = camera;
            edit = true;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {

            Incendios0_1.firedataDataSet firedataDataSet = ((Incendios0_1.firedataDataSet)(this.FindResource("firedataDataSet")));
            // Load data into the table IPCameras. You can modify this code as needed.
            Incendios0_1.firedataDataSetTableAdapters.IPCamerasTableAdapter firedataDataSetIPCamerasTableAdapter = new Incendios0_1.firedataDataSetTableAdapters.IPCamerasTableAdapter();
            firedataDataSetIPCamerasTableAdapter.Fill(firedataDataSet.IPCameras);
            System.Windows.Data.CollectionViewSource iPCamerasViewSource = ((System.Windows.Data.CollectionViewSource)(this.FindResource("iPCamerasViewSource")));
            if (edit)
            {
                iPCamerasViewSource.View.MoveCurrentTo(camera);
            }
            else
            {
               
            }

        }
    }
}
